<% layout('/layouts/default.html', {title: '批示页面', libs: ['validate','fileupload']}){ %>
<div class="main-content">
	<div class="box box-main">
		<#form:form id="inputForm" model="" action="${ctx}/taskdeploy/dcSupTaskInfo/saveArrange?taskId=${arrange.taskId}" method="post" class="form-horizontal">
			<div class="box-body">
				<div class="form-unit">基本信息</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('任务标题')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<label class="control-label" style="text-align: left;white-space: pre-line; word-wrap:break-word;">${dcSupTaskInfo.taskTitle}</label>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('任务内容')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<label class="control-label" style="text-align: left;white-space: pre-line;" >${dcSupTaskInfo.taskContent}</label>
							</div>
						</div>
					</div>
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('附件')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:fileupload id="uploadFile" bizKey="${dcSupTaskInfo.id}" bizType="dcSupTaskInfo_file"
								uploadType="all" class="" readonly="true" preview="true"/>
							</div>
						</div>
					</div>
				<div class="form-unit showInfo">整理内容</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required">*</span> ${text('最新进展情况')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:textarea path="arrangeContent" rows="10" style="width:90%" maxlength="450" style="white-space: pre-line;" placeholder="请逐条填写，新增一条则另起一行，450字以内" class="form-control required"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('存在问题')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:textarea path="arrangeContent2" rows="10" style="width:90%" maxlength="150" style="white-space: pre-line;" placeholder="请逐条填写，新增一条则另起一行，150字以内" class="form-control"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('拟采取的工作举措')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:textarea path="arrangeContent3" rows="10" style="width:90%" maxlength="200" style="white-space: pre-line;" placeholder="请逐条填写，新增一条则另起一行，200字以内" class="form-control"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('任务状态')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:radio path="taskArrangeStatus" dictType="dc_task_arrange_status" class="form-control" defaultValue="1"/>
							</div>
						</div>
					</div>
				</div>
					<% if(dcSupTaskInfo.normalFlag == '2'){ %>
					<div class="row">
						<div class="col-xs-12">
							<div class="form-group">
								<label class="control-label col-sm-2" title="">
									<span class="required hide">*</span> ${text('是否审核')}：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-10">
									<#form:radio path="auditFlag" dictType="sys_yes_no" class="form-control" defaultValue="1"/>
									<span style="color:gray">(如果选否，则默认审核通过，不会向领导发送消息)</span>
								</div>
							</div>
						</div>
					</div>
					<% } %>
			</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">
						<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('提 交')}</button>&nbsp;
						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>
	var list = ${toJson(maps)};
	var html="\t\t\t\t<div class=\"form-unit showInfo\">反馈信息</div>\n";
	$.each(list,function (dex,value) {
		var fileHtml="";
		if(value.fileList){
			$.each(value.fileList,function (index,item) {
				var fileId ='${ctx}/file/download/'+item.id
				fileHtml += '<a style="color: #226DDA" href="'+fileId+'"><i class="fa fa-fw fa-file"></i> '+item.file_name+' </a><br>'
			})
		}
		if(value){
		 html=html+
		"\t\t\t\t<!--基本任务信息-->\n" +
		"\t\t\t\t<div class=\"row\">\n" +
				 "\t\t\t\t\t<div class=\"col-xs-6\">\n" +
				 "\t\t\t\t\t\t<div class=\"form-group\">\n" +
				 "\t\t\t\t\t\t\t<label class=\"control-label col-sm-4\" title=\"\">\n" +
				 "\t\t\t\t\t\t\t\t<span class=\"required hide\">*</span> 反馈节点：<i class=\"fa icon-question hide\"></i></label>\n" +
				 "\t\t\t\t\t\t\t<div class=\"col-sm-8\">\n" +
				 "\t\t\t\t\t\t\t\t<label class=\"control-label\">"+value.feedback_time+"</label>\n" +
				 "\t\t\t\t\t\t\t</div>\n" +
				 "\t\t\t\t\t\t</div>\n" +
				 "\t\t\t\t\t</div>\n" +
		"\t\t\t\t\t<div class=\"col-xs-6\">\n" +
		"\t\t\t\t\t\t<div class=\"form-group\">\n" +
		"\t\t\t\t\t\t\t<label class=\"control-label col-sm-4\" title=\"\">\n" +
		"\t\t\t\t\t\t\t\t<span class=\"required hide\">*</span> 牵头责任单位：<i class=\"fa icon-question hide\"></i></label>\n" +
		"\t\t\t\t\t\t\t<div class=\"col-sm-8\">\n" +
		"\t\t\t\t\t\t\t\t<label class=\"control-label\" >"+value.leader_org_name+"</label>\n" +
		"\t\t\t\t\t\t\t</div>\n" +
		"\t\t\t\t\t\t</div>\n" +
		"\t\t\t\t\t</div>\n" +
				 "\t\t\t\t</div>"+
			"\t\t\t\t<div class=\"row\">\n" +
		"\t\t\t\t\t<div class=\"col-xs-12\">\n" +
		"\t\t\t\t\t\t<div class=\"form-group\">\n" +
		"\t\t\t\t\t\t\t<label class=\"control-label col-sm-2\"  title=\"\">\n" +
		"\t\t\t\t\t\t\t\t<span class=\"required hide\">*</span> 最新进展情况：<i class=\"fa icon-question hide\"></i></label>\n" +
		"\t\t\t\t\t\t\t<div class=\"col-sm-10\">\n" +
		"\t\t\t\t\t\t\t\t<label class=\"control-label\" style=\"white-space: pre-line;\"><span style=\"text-align:left;display: block;\">"+value.feedback_content+"</span></label>\n" +
		"\t\t\t\t\t\t\t</div>\n" +
		"\t\t\t\t\t\t</div>\n" +
		"\t\t\t\t\t</div>\n" +
			"\t\t\t\t\t</div>\n"+
			"\t\t\t\t<div class=\"row\">\n" +
			"\t\t\t\t\t<div class=\"col-xs-12\">\n" +
			"\t\t\t\t\t\t<div class=\"form-group\">\n" +
			"\t\t\t\t\t\t\t<label class=\"control-label col-sm-2\"  title=\"\">\n" +
			"\t\t\t\t\t\t\t\t<span class=\"required hide\">*</span> 存在问题：<i class=\"fa icon-question hide\"></i></label>\n" +
			"\t\t\t\t\t\t\t<div class=\"col-sm-10\">\n" +
			"\t\t\t\t\t\t\t\t<label class=\"control-label\" style=\"white-space: pre-line;\"><span style=\"text-align:left;display: block;\">"+value.feedback_advice+"</span></label>\n" +
			"\t\t\t\t\t\t\t</div>\n" +
			"\t\t\t\t\t\t</div>\n" +
			"\t\t\t\t\t</div>\n" +
			"\t\t\t\t\t</div>\n"+
				 "\t\t\t\t<div class=\"row\">\n" +
				 "\t\t\t\t\t<div class=\"col-xs-12\">\n" +
				 "\t\t\t\t\t\t<div class=\"form-group\">\n" +
				 "\t\t\t\t\t\t\t<label class=\"control-label col-sm-2\"  title=\"\">\n" +
				 "\t\t\t\t\t\t\t\t<span class=\"required hide\">*</span> 拟采取的工作举措：<i class=\"fa icon-question hide\"></i></label>\n" +
				 "\t\t\t\t\t\t\t<div class=\"col-sm-10\">\n" +
				 "\t\t\t\t\t\t\t\t<label class=\"control-label\" style=\"white-space: pre-line;\"><span style=\"text-align:left;display: block;\">"+value.feedback_measure+"</span></label>\n" +
				 "\t\t\t\t\t\t\t</div>\n" +
				 "\t\t\t\t\t\t</div>\n" +
				 "\t\t\t\t\t</div>\n"+
				 "\t\t\t\t\t</div>\n"+
				 "\t\t\t\t<div class=\"row\">\n" +
				 "\t\t\t\t\t<div class=\"col-xs-12\">\n" +
				 "\t\t\t\t\t\t<div class=\"form-group\">\n" +
				 "\t\t\t\t\t\t\t<label class=\"control-label col-sm-2\"  title=\"\">\n" +
				 "\t\t\t\t\t\t\t\t<span class=\"required hide\">*</span> 附件：<i class=\"fa icon-question hide\"></i></label>\n" +
				 "\t\t\t\t\t\t\t<div class=\"col-sm-10\">\n" +
				 fileHtml+
				 "\t\t\t\t\t\t\t</div>\n" +
				 "\t\t\t\t\t\t</div>\n" +
				 "\t\t\t\t\t</div>\n" +
				 "\t\t\t\t\t</div>\n"

		}else{
			html='';
		}
	})
	$('.showInfo').before(html)
$("#inputForm").validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == Global.TRUE){
				js.closeCurrentTabPage(function(contentWindow){
					contentWindow.page();
				});
			}
		}, "json");
    }
});
</script>